﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using System;


namespace XLua
{
    public static partial class CopyByValue
    {
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out XLuaTest.Pedding val)
		{
		    val = new XLuaTest.Pedding();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "c"))
            {
			    
                translator.Get(L, top + 1, out val.c);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, XLuaTest.Pedding field)
        {
            
            if(!Pack(buff, offset, field.c))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out XLuaTest.Pedding field)
        {
            field = default(XLuaTest.Pedding);
            
            if(!UnPack(buff, offset, out field.c))
            {
                return false;
            }
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out XLuaTest.MyStruct val)
		{
		    val = new XLuaTest.MyStruct();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "b"))
            {
			    
                translator.Get(L, top + 1, out val.b);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "c"))
            {
			    
                translator.Get(L, top + 1, out val.c);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "e"))
            {
			    
                translator.Get(L, top + 1, out val.e);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, XLuaTest.MyStruct field)
        {
            
            if(!Pack(buff, offset, field.a))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 4, field.b))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 8, field.c))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 24, field.e))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out XLuaTest.MyStruct field)
        {
            field = default(XLuaTest.MyStruct);
            
            if(!UnPack(buff, offset, out field.a))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 4, out field.b))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 8, out field.c))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 24, out field.e))
            {
                return false;
            }
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Vector2 val)
		{
		    val = new UnityEngine.Vector2();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "x"))
            {
			    
                translator.Get(L, top + 1, out val.x);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "y"))
            {
			    
                translator.Get(L, top + 1, out val.y);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, UnityEngine.Vector2 field)
        {
            
            if(!LuaAPI.xlua_pack_float2(buff, offset, field.x, field.y))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Vector2 field)
        {
            field = default(UnityEngine.Vector2);
            
            float x = default(float);
            float y = default(float);
            
            if(!LuaAPI.xlua_unpack_float2(buff, offset, out x, out y))
            {
                return false;
            }
            field.x = x;
            field.y = y;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Vector3 val)
		{
		    val = new UnityEngine.Vector3();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "x"))
            {
			    
                translator.Get(L, top + 1, out val.x);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "y"))
            {
			    
                translator.Get(L, top + 1, out val.y);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "z"))
            {
			    
                translator.Get(L, top + 1, out val.z);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, UnityEngine.Vector3 field)
        {
            
            if(!LuaAPI.xlua_pack_float3(buff, offset, field.x, field.y, field.z))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Vector3 field)
        {
            field = default(UnityEngine.Vector3);
            
            float x = default(float);
            float y = default(float);
            float z = default(float);
            
            if(!LuaAPI.xlua_unpack_float3(buff, offset, out x, out y, out z))
            {
                return false;
            }
            field.x = x;
            field.y = y;
            field.z = z;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Vector4 val)
		{
		    val = new UnityEngine.Vector4();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "x"))
            {
			    
                translator.Get(L, top + 1, out val.x);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "y"))
            {
			    
                translator.Get(L, top + 1, out val.y);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "z"))
            {
			    
                translator.Get(L, top + 1, out val.z);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "w"))
            {
			    
                translator.Get(L, top + 1, out val.w);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, UnityEngine.Vector4 field)
        {
            
            if(!LuaAPI.xlua_pack_float4(buff, offset, field.x, field.y, field.z, field.w))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Vector4 field)
        {
            field = default(UnityEngine.Vector4);
            
            float x = default(float);
            float y = default(float);
            float z = default(float);
            float w = default(float);
            
            if(!LuaAPI.xlua_unpack_float4(buff, offset, out x, out y, out z, out w))
            {
                return false;
            }
            field.x = x;
            field.y = y;
            field.z = z;
            field.w = w;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Color val)
		{
		    val = new UnityEngine.Color();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "r"))
            {
			    
                translator.Get(L, top + 1, out val.r);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "g"))
            {
			    
                translator.Get(L, top + 1, out val.g);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "b"))
            {
			    
                translator.Get(L, top + 1, out val.b);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, UnityEngine.Color field)
        {
            
            if(!LuaAPI.xlua_pack_float4(buff, offset, field.r, field.g, field.b, field.a))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Color field)
        {
            field = default(UnityEngine.Color);
            
            float r = default(float);
            float g = default(float);
            float b = default(float);
            float a = default(float);
            
            if(!LuaAPI.xlua_unpack_float4(buff, offset, out r, out g, out b, out a))
            {
                return false;
            }
            field.r = r;
            field.g = g;
            field.b = b;
            field.a = a;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Quaternion val)
		{
		    val = new UnityEngine.Quaternion();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "x"))
            {
			    
                translator.Get(L, top + 1, out val.x);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "y"))
            {
			    
                translator.Get(L, top + 1, out val.y);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "z"))
            {
			    
                translator.Get(L, top + 1, out val.z);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "w"))
            {
			    
                translator.Get(L, top + 1, out val.w);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, UnityEngine.Quaternion field)
        {
            
            if(!LuaAPI.xlua_pack_float4(buff, offset, field.x, field.y, field.z, field.w))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Quaternion field)
        {
            field = default(UnityEngine.Quaternion);
            
            float x = default(float);
            float y = default(float);
            float z = default(float);
            float w = default(float);
            
            if(!LuaAPI.xlua_unpack_float4(buff, offset, out x, out y, out z, out w))
            {
                return false;
            }
            field.x = x;
            field.y = y;
            field.z = z;
            field.w = w;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Ray val)
		{
		    val = new UnityEngine.Ray();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "origin"))
            {
			    
				var origin = val.origin;
				translator.Get(L, top + 1, out origin);
				val.origin = origin;
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "direction"))
            {
			    
				var direction = val.direction;
				translator.Get(L, top + 1, out direction);
				val.direction = direction;
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, UnityEngine.Ray field)
        {
            
            if(!Pack(buff, offset, field.origin))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 12, field.direction))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Ray field)
        {
            field = default(UnityEngine.Ray);
            
            var origin = field.origin;
            if(!UnPack(buff, offset, out origin))
            {
                return false;
            }
            field.origin = origin;
            
            var direction = field.direction;
            if(!UnPack(buff, offset + 12, out direction))
            {
                return false;
            }
            field.direction = direction;
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Bounds val)
		{
		    val = new UnityEngine.Bounds();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "center"))
            {
			    
				var center = val.center;
				translator.Get(L, top + 1, out center);
				val.center = center;
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "extents"))
            {
			    
				var extents = val.extents;
				translator.Get(L, top + 1, out extents);
				val.extents = extents;
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, UnityEngine.Bounds field)
        {
            
            if(!Pack(buff, offset, field.center))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 12, field.extents))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Bounds field)
        {
            field = default(UnityEngine.Bounds);
            
            var center = field.center;
            if(!UnPack(buff, offset, out center))
            {
                return false;
            }
            field.center = center;
            
            var extents = field.extents;
            if(!UnPack(buff, offset + 12, out extents))
            {
                return false;
            }
            field.extents = extents;
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out UnityEngine.Ray2D val)
		{
		    val = new UnityEngine.Ray2D();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "origin"))
            {
			    
				var origin = val.origin;
				translator.Get(L, top + 1, out origin);
				val.origin = origin;
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "direction"))
            {
			    
				var direction = val.direction;
				translator.Get(L, top + 1, out direction);
				val.direction = direction;
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, UnityEngine.Ray2D field)
        {
            
            if(!Pack(buff, offset, field.origin))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 8, field.direction))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out UnityEngine.Ray2D field)
        {
            field = default(UnityEngine.Ray2D);
            
            var origin = field.origin;
            if(!UnPack(buff, offset, out origin))
            {
                return false;
            }
            field.origin = origin;
            
            var direction = field.direction;
            if(!UnPack(buff, offset + 8, out direction))
            {
                return false;
            }
            field.direction = direction;
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out TestStruct val)
		{
		    val = new TestStruct();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "b"))
            {
			    
                translator.Get(L, top + 1, out val.b);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "c"))
            {
			    
                translator.Get(L, top + 1, out val.c);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "e"))
            {
			    
                translator.Get(L, top + 1, out val.e);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, TestStruct field)
        {
            
            if(!Pack(buff, offset, field.a))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 4, field.b))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 8, field.c))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 24, field.e))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out TestStruct field)
        {
            field = default(TestStruct);
            
            if(!UnPack(buff, offset, out field.a))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 4, out field.b))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 8, out field.c))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 24, out field.e))
            {
                return false;
            }
            
            return true;
        }
        
		
        public static bool Pack(IntPtr buff, int offset, Pedding field)
        {
            
            if(!Pack(buff, offset, field.c))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out Pedding field)
        {
            field = default(Pedding);
            
            if(!UnPack(buff, offset, out field.c))
            {
                return false;
            }
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out StaticPusherStructA val)
		{
		    val = new StaticPusherStructA();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "byteVar"))
            {
			    
                translator.Get(L, top + 1, out val.byteVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "sbyteVar"))
            {
			    
                translator.Get(L, top + 1, out val.sbyteVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, StaticPusherStructA field)
        {
            
            if(!Pack(buff, offset, field.byteVar))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 1, field.sbyteVar))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out StaticPusherStructA field)
        {
            field = default(StaticPusherStructA);
            
            if(!UnPack(buff, offset, out field.byteVar))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 1, out field.sbyteVar))
            {
                return false;
            }
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out StaticPusherStructB val)
		{
		    val = new StaticPusherStructB();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "shortVar"))
            {
			    
                translator.Get(L, top + 1, out val.shortVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "ushortVar"))
            {
			    
                translator.Get(L, top + 1, out val.ushortVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "intVar"))
            {
			    
                translator.Get(L, top + 1, out val.intVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "uintVar"))
            {
			    
                translator.Get(L, top + 1, out val.uintVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, StaticPusherStructB field)
        {
            
            if(!Pack(buff, offset, field.shortVar))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 2, field.ushortVar))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 4, field.intVar))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 8, field.uintVar))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out StaticPusherStructB field)
        {
            field = default(StaticPusherStructB);
            
            if(!UnPack(buff, offset, out field.shortVar))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 2, out field.ushortVar))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 4, out field.intVar))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 8, out field.uintVar))
            {
                return false;
            }
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out StaticPusherStructAll val)
		{
		    val = new StaticPusherStructAll();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "longVar"))
            {
			    
                translator.Get(L, top + 1, out val.longVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "ulongVar"))
            {
			    
                translator.Get(L, top + 1, out val.ulongVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "floatVar"))
            {
			    
                translator.Get(L, top + 1, out val.floatVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "doubleVar"))
            {
			    
                translator.Get(L, top + 1, out val.doubleVar);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "structA"))
            {
			    
                translator.Get(L, top + 1, out val.structA);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "structB"))
            {
			    
                translator.Get(L, top + 1, out val.structB);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, StaticPusherStructAll field)
        {
            
            if(!Pack(buff, offset, field.longVar))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 8, field.ulongVar))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 16, field.floatVar))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 20, field.doubleVar))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 28, field.structA))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 30, field.structB))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out StaticPusherStructAll field)
        {
            field = default(StaticPusherStructAll);
            
            if(!UnPack(buff, offset, out field.longVar))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 8, out field.ulongVar))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 16, out field.floatVar))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 20, out field.doubleVar))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 28, out field.structA))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 30, out field.structB))
            {
                return false;
            }
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out Gen2FloatStruct val)
		{
		    val = new Gen2FloatStruct();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "b"))
            {
			    
                translator.Get(L, top + 1, out val.b);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, Gen2FloatStruct field)
        {
            
            if(!LuaAPI.xlua_pack_float2(buff, offset, field.a, field.b))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out Gen2FloatStruct field)
        {
            field = default(Gen2FloatStruct);
            
            float a = default(float);
            float b = default(float);
            
            if(!LuaAPI.xlua_unpack_float2(buff, offset, out a, out b))
            {
                return false;
            }
            field.a = a;
            field.b = b;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out Gen3FloatStruct val)
		{
		    val = new Gen3FloatStruct();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "b"))
            {
			    
                translator.Get(L, top + 1, out val.b);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "c"))
            {
			    
                translator.Get(L, top + 1, out val.c);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, Gen3FloatStruct field)
        {
            
            if(!LuaAPI.xlua_pack_float3(buff, offset, field.a, field.b, field.c))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out Gen3FloatStruct field)
        {
            field = default(Gen3FloatStruct);
            
            float a = default(float);
            float b = default(float);
            float c = default(float);
            
            if(!LuaAPI.xlua_unpack_float3(buff, offset, out a, out b, out c))
            {
                return false;
            }
            field.a = a;
            field.b = b;
            field.c = c;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out Gen4FloatStruct val)
		{
		    val = new Gen4FloatStruct();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "b"))
            {
			    
                translator.Get(L, top + 1, out val.b);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "c"))
            {
			    
                translator.Get(L, top + 1, out val.c);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "d"))
            {
			    
                translator.Get(L, top + 1, out val.d);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, Gen4FloatStruct field)
        {
            
            if(!LuaAPI.xlua_pack_float4(buff, offset, field.a, field.b, field.c, field.d))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out Gen4FloatStruct field)
        {
            field = default(Gen4FloatStruct);
            
            float a = default(float);
            float b = default(float);
            float c = default(float);
            float d = default(float);
            
            if(!LuaAPI.xlua_unpack_float4(buff, offset, out a, out b, out c, out d))
            {
                return false;
            }
            field.a = a;
            field.b = b;
            field.c = c;
            field.d = d;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out Gen5FloatStruct val)
		{
		    val = new Gen5FloatStruct();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "b"))
            {
			    
                translator.Get(L, top + 1, out val.b);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "c"))
            {
			    
                translator.Get(L, top + 1, out val.c);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "d"))
            {
			    
                translator.Get(L, top + 1, out val.d);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "e"))
            {
			    
                translator.Get(L, top + 1, out val.e);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, Gen5FloatStruct field)
        {
            
            if(!LuaAPI.xlua_pack_float5(buff, offset, field.a, field.b, field.c, field.d, field.e))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out Gen5FloatStruct field)
        {
            field = default(Gen5FloatStruct);
            
            float a = default(float);
            float b = default(float);
            float c = default(float);
            float d = default(float);
            float e = default(float);
            
            if(!LuaAPI.xlua_unpack_float5(buff, offset, out a, out b, out c, out d, out e))
            {
                return false;
            }
            field.a = a;
            field.b = b;
            field.c = c;
            field.d = d;
            field.e = e;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out Gen6FloatStruct val)
		{
		    val = new Gen6FloatStruct();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "b"))
            {
			    
                translator.Get(L, top + 1, out val.b);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "c"))
            {
			    
                translator.Get(L, top + 1, out val.c);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "d"))
            {
			    
                translator.Get(L, top + 1, out val.d);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "e"))
            {
			    
                translator.Get(L, top + 1, out val.e);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "f"))
            {
			    
                translator.Get(L, top + 1, out val.f);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, Gen6FloatStruct field)
        {
            
            if(!LuaAPI.xlua_pack_float6(buff, offset, field.a, field.b, field.c, field.d, field.e, field.f))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out Gen6FloatStruct field)
        {
            field = default(Gen6FloatStruct);
            
            float a = default(float);
            float b = default(float);
            float c = default(float);
            float d = default(float);
            float e = default(float);
            float f = default(float);
            
            if(!LuaAPI.xlua_unpack_float6(buff, offset, out a, out b, out c, out d, out e, out f))
            {
                return false;
            }
            field.a = a;
            field.b = b;
            field.c = c;
            field.d = d;
            field.e = e;
            field.f = f;
            
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out TableAutoTransSimpleStruct val)
		{
		    val = new TableAutoTransSimpleStruct();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, TableAutoTransSimpleStruct field)
        {
            
            if(!Pack(buff, offset, field.a))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out TableAutoTransSimpleStruct field)
        {
            field = default(TableAutoTransSimpleStruct);
            
            if(!UnPack(buff, offset, out field.a))
            {
                return false;
            }
            
            return true;
        }
        
		
		public static void UnPack(ObjectTranslator translator, RealStatePtr L, int idx, out TableAutoTransComplexStruct val)
		{
		    val = new TableAutoTransComplexStruct();
            int top = LuaAPI.lua_gettop(L);
			
			if (Utils.LoadField(L, idx, "a"))
            {
			    
                translator.Get(L, top + 1, out val.a);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "b"))
            {
			    
                translator.Get(L, top + 1, out val.b);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "c"))
            {
			    
                translator.Get(L, top + 1, out val.c);
				
            }
            LuaAPI.lua_pop(L, 1);
			
			if (Utils.LoadField(L, idx, "d"))
            {
			    
                translator.Get(L, top + 1, out val.d);
				
            }
            LuaAPI.lua_pop(L, 1);
			
		}
		
        public static bool Pack(IntPtr buff, int offset, TableAutoTransComplexStruct field)
        {
            
            if(!Pack(buff, offset, field.a))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 4, field.b))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 8, field.c))
            {
                return false;
            }
            
            if(!Pack(buff, offset + 24, field.d))
            {
                return false;
            }
            
            return true;
        }
        public static bool UnPack(IntPtr buff, int offset, out TableAutoTransComplexStruct field)
        {
            field = default(TableAutoTransComplexStruct);
            
            if(!UnPack(buff, offset, out field.a))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 4, out field.b))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 8, out field.c))
            {
                return false;
            }
            
            if(!UnPack(buff, offset + 24, out field.d))
            {
                return false;
            }
            
            return true;
        }
        
    }
}